package cn.gmcx.lazy.izze.utils;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;


public class DateSumUtils {
    public static String DateSum(String origin_date,Long daysToAdd){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate localDate = LocalDate.parse(origin_date,formatter);

        LocalDate next_day = localDate.plusDays(daysToAdd);
        return next_day.format(formatter);
    }

    public static String DateMinus(String origin_date,Long daysToMinus){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate localDate = LocalDate.parse(origin_date,formatter);

        LocalDate next_day = localDate.minusDays(daysToMinus);
        return next_day.format(formatter);
    }

}
